home *** CD-ROM | disk | FTP | other *** search
/ Aminet 34 / Aminet 34 (2000)(Schatztruhe)[!][Dec 1999].iso / Aminet / comm / irc / cybershiela.lha / cs / tempconvert.amirx < prev    next >
Text File  |  1999-08-02  |  808b  |  40 lines

  1. /* Zonkerz TempConvert Beta 1
  2. for Amirc 2.0+
  3. 16 January 1999
  4. */
  5.  
  6. options results
  7. parse arg temp cf
  8. numeric digits 4
  9.  
  10. if temp="?" then signal HELP
  11. if temp="" then signal INVALID
  12. if cf="" then signal INVALID
  13. if upper(cf)="F" then signal FAREN
  14. if upper(cf)="C" then signal CELCIUS
  15.  
  16.  
  17. /* convert to Celcius */
  18. FAREN:
  19. temp=temp
  20. z=((temp-32)*5)/9
  21. 'say 6 'temp' F = 'z' C'
  22. exit
  23.  
  24. /* convert to Celcius */
  25. CELCIUS:
  26. z=((temp*9)/5)+32
  27. 'say 6 'temp' C = 'z' F'
  28. exit
  29.  
  30.  
  31. INVALID:
  32. 'say Invalid Argument !temp value F or C !temp ? for help'
  33. exit
  34.  
  35. HELP:
  36. 'say 3Usage !temp [deg] [C or F]'
  37. 'say 3To convert from Celcius to Fahrenheit put in the Celcius Temperature.  Example 5 C  you would type !temp 5 C'
  38. 'say 3To convert fromFahrenheit to Celcius put in the Fahrenheit Temperature.  Example 5 F would type !temp 5 F'
  39. exit
  40.